package com.cswangdao.controller.user;

import com.cswangdao.domain.model.MarketAddress;
import com.cswangdao.result.PageResult;
import com.cswangdao.result.Result;
import com.cswangdao.service.AddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx/address")
@Slf4j
public class WxAddressController {

    @Autowired
    private AddressService addressService;

    @GetMapping("/list")
    public Result<PageResult<MarketAddress>> list(){
        log.info(("查询用户地址列表"));
        PageResult<MarketAddress> pageResult = addressService.getAddressByUserId();
        return Result.success(pageResult);
    }
}
